<template>
  <view class="xuni-tabbar-bottom" >
    <view style="height:160rpx;width:100%;"></view>
    <view style="position: fixed;top:0rpx;left:0rpx;z-index:99;width:100%;" :style="'background: '+bgColor+';'">
      <view style="height: 80rpx;"></view>
      <view class="uni-flex uni-row" style="color:#FFFFFF;height: 80rpx;line-height: 80rpx;font-weight: bold;padding:0rpx 60rpx;">
        <view class="flex-item" style="width:5%" @click="xGoBack()">
          <uni-icons type="back" size="25" color="#FFFFFF"></uni-icons>
        </view>
        <view class="flex-item" style="width:90%;text-align: center;">
          {{title}}
        </view>
      </view>
    </view>
  </view>
</template>
<script>
export default {
  name: "headBar",
  data() {
    return {
      bgColor:'#fbc02d'
    }
  },


  mounted: function () {
    this.setBgColor();
  },

  methods: {
    setBgColor(){
      var t =this;
      if(t.color){
        t.bgColor = t.color;
      }
    },
    // 后退
    xGoBack(){
      var t = this;
      t.x_back()
    }
  },
  props: ["title","color"],
};
</script>
<style>


</style>
